<!-- templates/login.html -->
<!DOCTYPE html>
<html>
<head>
  <title>登录</title>
</head>
<body>
  {% with messages = get_flashed_messages() %}
    {% if messages %}
      <ul>
      {% for message in messages %}
        <li style="color:red">{{ message }}</li>
      {% endfor %}
      </ul>
    {% endif %}
  {% endwith %}

  <form action="{{ url_for('auth.login') }}" method="post">
    <legend>用户登录：</legend>
    <p><input name="username" placeholder="用户名" required></p>
    <p><input name="password" type="password" placeholder="密码" required></p>
    <p><button type="submit">登录</button></p>
  </form>
  <p>没有账号？<a href="{{ url_for('auth.register') }}">注册新账户</a></p>
</body>
</html>
